<!-- MAIN CONTENT -->
<div id="content">
    <div smart-include="sensor/views/sub-header.tpl.html"></div>
    <div class="clearfix">
        <div class="pull-left">
            <label class="input">
                <input type="text" class="ipt_form lineHeight" style="vertical-align: middle; padding: 0 10px" ng-model="paginationConf.deviceid" placeholder="设备号">
            </label>
        </div>
        <div class="pull-left margin-left-10">
            <strong class="font-md">处理：</strong>
            <label class="input">
                <select name="" class="ipt_form lineHeight" ng-model="paginationConf.handle_status">
                    <option value="">全部</option>
                    <option value="1">是</option>
                    <option value="0">否</option>
                </select>
            </label>
        </div>
        <div class="pull-left margin-left-10 My_pc">
            <strong class="font-md">时间范围：</strong>
            <label class="input">
                <input type="text" name="startdate" id="startdate" class="lineHeight" ng-model="paginationConf.timefrom" placeholder="开始日期：">
            </label>
            -
            <label class="input">
                <input type="text" name="finishdate" id="finishdate" class="lineHeight" placeholder="结束日期：" ng-model="paginationConf.timeto">
            </label>
        </div>
        <div class="pull-left margin-left-10">
            <a class="btn btn-primary" href-void="" ng-click="sends()">查询</a>
        </div>
    </div>
    <div class="table-responsive">
        <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
            <thead>
                <tr>
                    <th ng-hide="normalUser">操作</th>
                    <th class="text-align-center">报警类型</th>
                    <th class="text-align-center">设备编号</th>
                    <th class="text-align-center">报警字段</th>
                    <th class="text-align-center">通知方式</th>
                    <th class="text-align-center">处理备注</th>
                    <th class="text-align-center">项目</th>
                    <th class="text-align-center">时间</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="data in datas">
                    <td ng-hide ="normalUser">
                        <button class='btn btn-xs btn-default' uib-tooltip='编辑' tooltip-append-to-body='true' ng-click="showEditAlert(data)"><i class='fa fa-pencil'></i>处理</button>
                    </td>
                    <td class="text-align-center">
                            {{data.warn_type_name}}
                    </td>
                    <td class="text-align-center">{{data.deviceid}}</td>
                   
                    <td class="text-align-center">{{data.fieldname}}</td>
                    <td class="text-align-center">
                            {{data.notice_type_name}}
                    </td>
                    <td class="text-align-center">{{ data.memo}}</td>
                    <td class="text-align-center">{{ data.proname}}</td>
                    <td class="text-align-center">{{data.time}}</td>
                </tr>
            </tbody>
            <tfoot></tfoot>
        </table>
    </div>
    <!-- end widget content -->
    <div class="dt-toolbar-footer">
        <tm-pagination conf="paginationConf"></tm-pagination>
    </div>
    
    <div class="modal fade" id="editAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">处理批注</h4>
                </div>
                <div class="modal-body">
                    <form class="smart-form">
                            <textarea rows="10" cols ="50" ng-model="editdata.memo" class="handle-alert form-control " placeholder="处理描述">
                                    
                            </textarea>

                          <footer>
                            <button type="button" class="btn btn-default" data-dismiss="modal">
                                关闭
                            </button>
                            <button type="submit" class="btn btn-primary" ng-click="updatedata()">
                                提交
                            </button>
                        </footer>
                    </form>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</div>
<script>
    var pagefunction = function () {
        // START AND FINISH DATE
        $('#startdate').datepicker({
            //dateFormat : 'dd.mm.yy',
            dateFormat: 'yy-mm-dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
            onSelect: function (selectedDate) {
                $('#finishdate').datepicker('option', 'minDate', selectedDate);
            }
        });
        $('#finishdate').datepicker({
            dateFormat: 'yy-mm-dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
            onSelect: function (selectedDate) {
                $('#startdate').datepicker('option', 'maxDate', selectedDate);
            }
        });
    };
    pagefunction();
</script>
<!-- END MAIN CONTENT -->